import request from '@/utils/request'

// 获取商品列表【旧接口，平台端商品列表】
export async function platformGoodsList<T>(params: T) {
  return request('/api/platform/platformGoodsList', {
    method: 'GET',
    params,
  });
}

// 创建优惠券
export async function addCoupon<T>(data: T) {
  return request('/api/backend/addCoupon', {
    method: 'POST',
    data,
  });
}

// 优惠券详情
export async function couponDetail<T>(params: T) {
  return request('/api/backend/couponDetail', {
    method: 'GET',
    params,
  });
}

// 修改优惠券
export async function updateCoupon<T>(data: T) {
  return request('/api/backend/updateCoupon', {
    method: 'POST',
    data,
  });
}

// 优惠券列表筛选项下拉列表
export async function couponFilterOptions<T>(params: T) {
  return request('/api/backend/couponFilterOptions', {
    method: 'GET',
    params,
  });
}

// 优惠券列表
export async function couponList<T>(params: T) {
  return request('/api/backend/couponList', {
    method: 'GET',
    params,
  });
}

// 结束优惠券
export async function setCouponOver<T>(data: T) {
  return request('/api/backend/setCouponOver', {
    method: 'POST',
    data,
  });
}

// 删除优惠券(仅已结束券可删除)
export async function deleteCoupon<T>(data: T) {
  return request('/api/backend/deleteCoupon', {
    method: 'POST',
    data,
  });
}

// 优惠券列表
export async function getShipTypes<T>(params: T) {
  return request('/api/platform/getShipTypes', {
    method: 'GET',
    params,
  });
}

// 优惠券列表订单信息
export async function couponOrderList<T>(params: T) {
  return request('/api/backend/couponOrderList', {
    method: 'GET',
    params,
  });
}